﻿using System.Linq;
using System.Runtime.CompilerServices;
using ZBJF.Warranty.Common.Enums.InsuranceProducts;
using ZBJF.Warranty.Model;
using ZBJF.Warranty.Model.ViewModel.InsuranceProducts;

namespace ZBJF.Warranty.IBLL
{
    public partial interface IInsuranceProductOrderService
    {
        InsuranceProductOrder LoadById(long id);
        InsuranceProductOrder LoadByOrderNo(string orderNo);
        IQueryable<InsuranceProductOrder> GetPagingList(InsuranceProductOrderModel model, out int total);
        /// <summary>
        /// 订单支付后调用的方法，生成卡密，发送邮件等
        /// </summary>
        /// <param name="orderNo"></param>
        /// <returns></returns>
        bool PayOrderAndCreateCard(string orderNo);
        /// <summary>
        /// 获得某一个月份的收入（一般是某个销售月的总收入）
        /// </summary>
        /// <param name="dtMonth"></param>
        /// <param name="employeeId"></param>
        /// <param name="sellerInsuranceProductId">商户SellerInsuranceProductID</param>
        /// <param name="status"></param>
        /// <returns></returns>
        decimal GetSellerInsuranceProductSaleIncome(string dtMonth, long employeeId, long sellerInsuranceProductId = 0, InsuranceProductOrderStatus status = InsuranceProductOrderStatus.Paid);
        /// <summary>
        /// 获得商户产品销量（非基础产品，基础产品从InsuranceProductOrderCardService中获取）
        /// </summary>
        /// <param name="dtMonth"></param>
        /// <param name="employeeId"></param>
        /// <param name="sellerInsuranceProductId"></param>
        /// <param name="status"></param>
        /// <returns></returns>
        long GetSellerInsuranceProductSaleCount(string dtMonth, long employeeId, long sellerInsuranceProductId, InsuranceProductOrderStatus status = InsuranceProductOrderStatus.Paid);
        /// <summary>
        /// 获取同一身份证已购买产品的数量（不能超过限制的量）
        /// </summary>
        /// <param name="sellerInsuranceProductID"></param>
        /// <param name="buyUserIDNo"></param>
        /// <returns></returns>
        int GetIdentityCardHasBuyQty(long sellerInsuranceProductID, string buyUserIDNo);
    }
}